# 调整到项目根目录，因为当前文件在较深的子目录下，需要正确定位路径
get_filename_component(PROJECT_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../../ ABSOLUTE)

# 添加头文件搜索路径
include_directories(
        ${PROJECT_ROOT_DIR}/include
)

# 收集源文件
set(STRING_SRC
        ${PROJECT_ROOT_DIR}/Circle/src/utils/string/String.cpp
)

# 编译为静态库
add_library(CircleUtilsString STATIC ${STRING_SRC})

# 安装目标
install(TARGETS CircleUtilsString
        ARCHIVE DESTINATION lib
)

# 收集当前目录下的头文件
set(STRING_INCLUDE_HEADERS
        ${CMAKE_CURRENT_SOURCE_DIR}/String.h
)

# 将头文件列表传递给父级 CMakeLists.txt
set(STRING_INCLUDE_HEADERS ${STRING_INCLUDE_HEADERS} PARENT_SCOPE)